package com.example.struction;

import java.util.LinkedList;
import java.util.Queue;

public class Main3
{
    public static void main(String[] args) {
        Queue<String> queue = new LinkedList<String>();
        queue.offer("A");
        queue.offer("B");
        queue.offer("C");
        queue.offer("D");
        queue.offer("E");
        for (String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("poll="+queue.poll());
        for (String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("element="+queue.element());
        for (String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("peek="+queue.peek());
        for (String q : queue){
            System.out.println(q);
        }
    }
}
